import os


basedir = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))


class Config(object):
    FLASK_WEB_NAME = '后台管理'
    SECRET_KEY = os.environ.get('SECRET_KEY') or '!@#$%^&*12345678'
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    POST_PRE_PAGE = 4

    CELERY_RESULT_BACKEND = 'redis://localhost:6379/4'
    CELERY_BROKER_URL = 'redis://localhost:6379/5'


class DevelopmentConfig(Config):
    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')


class ProductionConfig(Config):
    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')


config = {
    'development': DevelopmentConfig,
    'production': ProductionConfig,
}
